const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
  mode: 'development',
  entry: path.resolve(process.cwd(), 'src/main.ts'),
  devServer: {
    hot: true,
    port: 8800
  },
  module: {
    rules:[
      {
        test: /\.tsx?$/,
        use:'awesome-typescript-loader',
        exclude:/node_modules/
      }
    ]
  },
  plugins: [
    new HtmlWebpackPlugin({
      template: './index.html'
    }),
    new webpack.NamedModulesPlugin(),
    new webpack.HotModuleReplacementPlugin()
  ],
  resolve: {
    extensions: ['.js', '.json', '.ts', '.tsc']
  }
}